.class Lcom/instagram/j/h;
.super Ljava/lang/Object;
.source "CommentRenderer.java"


# static fields
.field private static final a:Ljava/util/regex/Pattern;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 25
    const-string v0, "(^|[^a-zA-Z0-9_]+)(@([a-zA-Z0-9_]+))"

    const/4 v1, 0x2

    invoke-static {v0, v1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;I)Ljava/util/regex/Pattern;

    move-result-object v0

    sput-object v0, Lcom/instagram/j/h;->a:Ljava/util/regex/Pattern;

    return-void
.end method

.method static a(Lcom/instagram/j/b;)Landroid/text/SpannableStringBuilder;
    .locals 2
    .parameter

    .prologue
    .line 41
    invoke-virtual {p0}, Lcom/instagram/j/b;->e()Ljava/lang/String;

    move-result-object v0

    if-nez v0, :cond_0

    .line 42
    const/4 v0, 0x0

    .line 48
    :goto_0
    return-object v0

    .line 45
    :cond_0
    new-instance v0, Landroid/text/SpannableStringBuilder;

    invoke-virtual {p0}, Lcom/instagram/j/b;->e()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V

    .line 46
    invoke-static {v0, p0}, Lcom/instagram/j/h;->a(Landroid/text/SpannableStringBuilder;Lcom/instagram/j/b;)V

    .line 47
    invoke-static {v0, p0}, Lcom/instagram/j/h;->b(Landroid/text/SpannableStringBuilder;Lcom/instagram/j/b;)V

    goto :goto_0
.end method

.method static a(Lcom/instagram/j/b;Landroid/text/SpannableStringBuilder;)Ljava/lang/CharSequence;
    .locals 5
    .parameter
    .parameter

    .prologue
    .line 29
    invoke-virtual {p0}, Lcom/instagram/j/b;->f()Lcom/instagram/android/model/b/e;

    move-result-object v0

    .line 30
    invoke-virtual {p0}, Lcom/instagram/j/b;->l()Lcom/instagram/j/l;

    move-result-object v1

    .line 32
    new-instance v2, Landroid/text/SpannableStringBuilder;

    invoke-direct {v2}, Landroid/text/SpannableStringBuilder;-><init>()V

    .line 33
    invoke-virtual {v0}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 34
    new-instance v3, Lcom/instagram/j/a;

    const-string v4, "comment_owner"

    invoke-direct {v3, v4, v0, v1}, Lcom/instagram/j/a;-><init>(Ljava/lang/String;Lcom/instagram/android/model/b/e;Lcom/instagram/j/l;)V

    .line 35
    const/4 v1, 0x0

    invoke-virtual {v0}, Lcom/instagram/android/model/b/e;->f()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    const/16 v4, 0x21

    invoke-virtual {v2, v3, v1, v0, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 36
    const-string v0, " "

    invoke-virtual {v2, v0}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/text/SpannableStringBuilder;->append(Ljava/lang/CharSequence;)Landroid/text/SpannableStringBuilder;

    .line 37
    return-object v2
.end method

.method private static a(Landroid/text/SpannableStringBuilder;Lcom/instagram/j/b;)V
    .locals 6
    .parameter
    .parameter

    .prologue
    const/4 v5, 0x2

    .line 52
    sget-object v0, Lcom/instagram/j/h;->a:Ljava/util/regex/Pattern;

    invoke-virtual {p1}, Lcom/instagram/j/b;->e()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v0

    .line 53
    :goto_0
    invoke-virtual {v0}, Ljava/util/regex/Matcher;->find()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 54
    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v1

    .line 55
    new-instance v2, Lcom/instagram/j/i;

    invoke-direct {v2, v1, p1}, Lcom/instagram/j/i;-><init>(Ljava/lang/String;Lcom/instagram/j/b;)V

    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->start(I)I

    move-result v1

    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->end(I)I

    move-result v3

    const/16 v4, 0x21

    invoke-virtual {p0, v2, v1, v3, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    goto :goto_0

    .line 68
    :cond_0
    return-void
.end method

.method private static b(Landroid/text/SpannableStringBuilder;Lcom/instagram/j/b;)V
    .locals 6
    .parameter
    .parameter

    .prologue
    const/4 v5, 0x1

    .line 71
    invoke-virtual {p1}, Lcom/instagram/j/b;->e()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/instagram/n/i;->a(Ljava/lang/String;)Ljava/util/regex/Matcher;

    move-result-object v0

    .line 72
    :goto_0
    invoke-virtual {v0}, Ljava/util/regex/Matcher;->find()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 73
    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;

    move-result-object v1

    .line 74
    new-instance v2, Lcom/instagram/j/j;

    invoke-direct {v2, v1, p1}, Lcom/instagram/j/j;-><init>(Ljava/lang/String;Lcom/instagram/j/b;)V

    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->start(I)I

    move-result v1

    invoke-virtual {v0, v5}, Ljava/util/regex/Matcher;->end(I)I

    move-result v3

    const/16 v4, 0x21

    invoke-virtual {p0, v2, v1, v3, v4}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    goto :goto_0

    .line 85
    :cond_0
    return-void
.end method
